import numpy as np
def readData(name):
    car_file = name + '/car.txt'
    car = []
    with open(car_file,'r') as file_to_read:
        a = 1
        b = 1
        while True:
            lines = file_to_read.readline()
            if not lines:
                break
            if a==1:
                a = 0
                continue
            lines = lines.strip()
            lines = lines.strip('()')
            lines = lines.strip().split(', ')
            p_temp = []
            for num in lines:
                p_temp.append(float(num))
            car.append(p_temp)
    cross_file = name + '/cross.txt'
    cross = []
    with open(cross_file, 'r') as file_to_read:
        a = 1
        b = 1
        while True:
            lines = file_to_read.readline()
            if not lines:
                break
            if a==1:
                a = 0
                continue
            lines = lines.strip()
            lines = lines.strip('()')
            lines = lines.strip().split(', ')
            p_temp = []
            for num in lines:
                p_temp.append(float(num))
            cross.append(p_temp)
    road_file = name + '/road.txt'
    road = []
    with open(road_file,'r') as file_to_read:
        a = 1
        b = 1
        while True:
            lines = file_to_read.readline()
            if not lines:
                break
            if a==1:
                a = 0
                continue
            lines = lines.strip()
            lines = lines.strip('()')
            lines = lines.strip().split(', ')
            p_temp = []
            for num in lines:
                p_temp.append(float(num))
            road.append(p_temp)
    return np.array(car, int), np.array(cross, int), np.array(road, int)
# print("yas")
 # haha = 1